/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.llantas.vista;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;

/**
 *
 * @author manuel
 */
@ManagedBean
@SessionScoped
public class accessBean {

    private String name;
private String password;

    public accessBean() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
    //--------aciones
    public String validarLogin(){
    if(name.equals("manuel")&password.equals("1234")){
        FacesContext context=FacesContext.getCurrentInstance();
        context.getExternalContext().getSessionMap().put("USUARIO_LOGUEADO", name);
    return "MenuPrincipal";
    }else{
    return "nada";
    }
    }
}
